#include "mainwindow.h"
#include "ui_mainwindow.h"

#include <QTextEdit>

MainWindow::MainWindow(QWidget *parent)
    : QMainWindow(parent)
    , ui(new Ui::MainWindow)
{
    ui->setupUi(this);
}

MainWindow::~MainWindow()
{
    delete ui;
}

void MainWindow::on_add_tab_clicked()
{
    QIcon icon1;
    icon1.addFile(QString::fromUtf8(":/image/bt_def.png"), QSize(), QIcon::Normal, QIcon::Off);
    QTextEdit*edit=new QTextEdit();
    ui->tabWidget->addTab(edit,icon1,"自定义");
}

void MainWindow::on_tabWidget_tabCloseRequested(int index)
{
    QWidget*w=ui->tabWidget->widget(index);
    ui->tabWidget->removeTab(index);
}
